package cn.wellwan.express;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Copyright (C),微动天下
 * FileName: Config
 * Author:   maokai
 * Date:     2018/12/19 11:34
 * Description: 快递鸟配置
 */
@Component
@ConfigurationProperties(prefix = "kdniao")
@Data
public class Config {
    private String id;
    private String key;
    private String host;

    public static class InterfaceURL {
        /**
         * 查询订单物流轨迹
         */
        public static final String ORDER_TRACES = "/Ebusiness/EbusinessOrderHandle.aspx";
    }

    /**
     * 获取url全路径
     *
     * @param interfaceURL
     * @return
     */
    public String getURL(String interfaceURL) {
        if (StringUtils.isNotBlank(interfaceURL))
            return this.getHost().concat(interfaceURL);
        return null;
    }
}
